<?php

session_start();
require( 'util.php' );

if (can_post_new_page())
{
    validate_action_post( array( 'aid', 'uid' ) );
    $uid = $_POST['uid'];
    $pid = $_POST['aid'];
    
    require( 'db.php' );
    
    $sql = "DELETE FROM `activity` WHERE p_id = $pid AND u_id = $uid";
    $result = mysql_query( $sql ) or report_err_and_exit( mysql_error() );

    redirect_and_exit( 'activity.php', '成功删除了指定活动参与者' );
}
else
{
    report_err_and_exit( '必须以领队或版主的身份登录' );
}

?>